<script setup>
import { onMounted, ref } from 'vue';
import { getTableData } from '@/api/apis/home';
//左下角tableData数据
const tableData = ref([])
//从mock中获取数据table
const getdata = async () => {
    const res = await getTableData()
    tableData.value = res.tableData

}

const tableLabel = ref({
    name: "课程",
    todayBuy: "今日购买",
    monthBuy: "本月购买",
    totalBuy: "总购买",
})

onMounted(() => getdata())
</script>
<template>
    <el-card shadow="hover" class="user-table">
        <el-table :data="tableData">
            <el-table-column v-for="(val, key) in tableLabel" :key="key" :prop="key" :label="val" />
        </el-table>

    </el-card>

</template>
<style lang="less" scoped>
.user-table {
    margin-top: 10px;
}
</style>